<?php
$oJobgroups = JobgroupHandler::getJobgroups();
?>
<script language="JavaScript">
	function job_change(iJob)
	{
		oForm = document.form_job_change;
		oForm.iJob.value = iJob;
<?php
// NOTE: This will be fixed when we SAJAXize this window.
if (count($oJobgroups) > 0) {
	?>
		oForm.iJobgroup.value = iJobgroups[iJob];
	<?php
}
?>
		oForm.sName.value = sNames[iJob];
		layerShow('layer_job_change');
		if (bChangers[iJob])
		{
			oForm.sName.disabled = false;
			oForm.sName.focus();
		}
		else
		{
			oForm.sName.disabled = true;
			oForm.iJobgroup.focus();
		}
	}
</script>
<div id="layer_job_change" class="hidden">
<form action="index.php" method="post" name="form_job_change">
<input type="hidden" name="sAction" value="job-change">
<input type="hidden" name="sView" value="job-list">
<input type="hidden" name="iJob">
<table class="boxborder" cellspacing="0">
	<tr>
		<td class="boxhandle" colspan="2"><?php print msg('Change project') ?></td>
	</tr>
	<tr>
		<td class="fieldname"><?php print msg('Name') ?>:</td>
		<td class="fieldvalue"><input type="text" size="20" name="sName"></td>
	</tr>
<?php
if (count($oJobgroups) > 0) {
	?>
	<tr>
		<td class="fieldname"><?php print msg('Group') ?>:</td>
		<td class="fieldvalue">
			<select name="iJobgroup">
				<option value="0">[ <?php print msg('None') ?> ]</option>
<?php
foreach ($oJobgroups as $oThisJobgroup)
{
	echo '<option value="'.$oThisJobgroup->iID.'">'.$oThisJobgroup->sName.'</option>';
}
?>
			</select>
		</td>
	</tr>
	<?php
}
?>
	<tr>
		<td class="boxbody" style="text-align: center;" colspan="2">
			<input type="submit" value="<?php print msg('OK') ?>">
			<input type="button" value="<?php print msg('Cancel') ?>" onClick="layerHide('layer_job_change');">
		</td>
	</tr>
</table>
</form>
</div>
